<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/8/13 0013
 * Time: 上午 10:10
 */
namespace app\admin\controller;
use app\common\controller\Curt;
class  Integral extends Curt {
    public function getall()
    {
        $keyword=trim(input('keyword'));
        if($keyword){
            $where['b.user_realname']=['like','%'.$keyword.'%'];//模糊查询or可以一个条件中写多个字段以‘|’分开
            $this->assign('keywords', $keyword);
        }
        if(trim(input('i_state'))){
            $where['a.i_state']=trim(input('i_state'));
            $this->assign('i_state', input('i_state'));
        }
        $where['a.status']=1;
        $list = $this->model
            ->alias('a')
            ->join(['ec_user'=>'b'],'a.user_id=b. id','left')
            ->order('id desc')
            ->field('a.*,b.user_realname')
            ->where($where)
            ->paginate();
        $page = $list->render();
        $this->assign('list', $list);
        $this->assign('page', $page);
    }

}